package com.ruoyi.ruoyiserver.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ruoyiserver.mapper.FusunChannelMapper;
import com.ruoyi.ruoyiserver.domain.FusunChannel;
import com.ruoyi.ruoyiserver.service.IFusunChannelService;

/**
 * 频道Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-17
 */
@Service
public class FusunChannelServiceImpl implements IFusunChannelService
{
    @Autowired
    private FusunChannelMapper fusunChannelMapper;

    /**
     * 查询频道
     *
     * @param id 频道主键
     * @return 频道
     */
    @Override
    public FusunChannel selectFusunChannelById(String id)
    {
        return fusunChannelMapper.selectFusunChannelById(id);
    }

    /**
     * 查询频道列表
     *
     * @param fusunChannel 频道
     * @return 频道
     */
    @Override
    public List<FusunChannel> selectFusunChannelList(FusunChannel fusunChannel)
    {
        return fusunChannelMapper.selectFusunChannelList(fusunChannel);
    }

    /**
     * 新增频道
     *
     * @param fusunChannel 频道
     * @return 结果
     */
    @Override
    public int insertFusunChannel(FusunChannel fusunChannel)
    {
        fusunChannel.setCreateTime(DateUtils.getNowDate());
        return fusunChannelMapper.insertFusunChannel(fusunChannel);
    }

    /**
     * 修改频道
     *
     * @param fusunChannel 频道
     * @return 结果
     */
    @Override
    public int updateFusunChannel(FusunChannel fusunChannel)
    {
        return fusunChannelMapper.updateFusunChannel(fusunChannel);
    }

    /**
     * 批量删除频道
     *
     * @param ids 需要删除的频道主键
     * @return 结果
     */
    @Override
    public int deleteFusunChannelByIds(String[] ids)
    {
        return fusunChannelMapper.deleteFusunChannelByIds(ids);
    }

    /**
     * 删除频道信息
     *
     * @param id 频道主键
     * @return 结果
     */
    @Override
    public int deleteFusunChannelById(String id)
    {
        return fusunChannelMapper.deleteFusunChannelById(id);
    }
}
